package com.depth.viewer.container
{
	import com.depth.viewer.facade.IocAppFacade;
	import com.depth.viewer.widget.IBaseWidget;
	import com.depth.viewer.container.definition.IWidgetContainerDefinition;
	
	import flash.events.Event;
	
	import mx.core.IVisualElement;
	import mx.events.FlexEvent;
	
	import spark.components.Group;
	import spark.components.SkinnableContainer;
	
	public class BaseLayoutContainer extends Group implements IWidgetContainer
	{
		public function BaseLayoutContainer()
		{
			super();
			this.percentHeight = 100;
			this.percentWidth = 100;
			
			//IocAppFacade.getInstance().registerMediator(new WidgetManager(this));
		}
		public function addWidget(widget:IBaseWidget,index:int = -1):IBaseWidget{
			var container:IWidgetContainer = widget as IWidgetContainer;
			var configParams:Object = container.configParams;
			var parentContainerId:String = configParams.parentContainer;
			
			if(parentContainerId || parentContainerId.length == 0){
				this[parentContainerId].addElement(widget as IVisualElement);
			}
			return widget;
		}
		public function removeWidget(id:String):IBaseWidget{
			return null;
		}
		public function getWidget(id:String):IBaseWidget{
			return null;
		}
		public function getWidgets():Array{
			return null;
		}
		public function containWidget(widget:IBaseWidget):Boolean{
			return false;
		}
		public function setWidgetLayout(value:Object):void{
			
		}
		public function focusWidget(id:String):void{
			
		}
		public function set configParams(value:IWidgetContainerDefinition):void{
			
		}
		public function get configParams():IWidgetContainerDefinition{
			return null;
		}
	}
}